home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 3
/
Light ROM 3 - Disc 2.iso
/
programs
/
amiga
/
macromkr
/
ripplean.lzh
/
SimpleRipple_decrease.fred
< prev
next >
Wrap
Text File
|
1993-10-02
|
3KB
|
121 lines
/* SimpleRipple_decrease.fred
** Clips Imported:
** FREDPhase - Current Phase amount (degrees)
** FREDPhaseIncrement - Phase increment per frame
** Clips Exported:
** FREDPhase - Current Phase amount (degrees)
** FREDOverrideLength - Override Length parameter flag
** (if 1, override the Length)
** NOTE: Clip names are case sensitive.
**
** This script requires FRED v1.2.0 (or higher) to run. Also required is
** ADPro v2.0.0 or MorphPlus v1.0.0.
*/
ADDRESS "ADPro"
OPTIONS RESULTS
PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
NL = '0A'X
/*
** Get the required clips. Error if any are missing.
*/
Phase = GETCLIP( "FREDPhase" )
IF (Phase = "") THEN DO
ADPRO_TO_FRONT
OKAY1 "Required clip, FREDPhase," || NL ||,
"is not specified."
ADPRO_TO_BACK
EXIT 10
END
PhaseIncrement = GETCLIP( "FREDPhaseIncrement" )
IF (PhaseIncrement = "") THEN DO
ADPRO_TO_FRONT
OKAY1 "Required clip, FREDPhaseIncrement," || NL ||,
"is not specified."
ADPRO_TO_BACK
EXIT 10
END
/*
** See what type of data is loaded in ADPro/MorphPlus.
*/
IMAGE_TYPE
ImageType = ADPRO_RESULT
IF ( WORD( ImageType, 1 ) = "NONE" ) THEN DO
ADPRO_TO_FRONT
OKAY1 "There is currently no image" || NL ||,
"in ADPro's buffer. An image" || NL ||,
"is required for this operation."
ADPRO_TO_BACK
EXIT 10
END
IF (WORD( ImageType, 1 ) = "BITPLANE") THEN DO
/*
** There's no raw data, but there is rendered data.
** The user must want us to modify the rendered data.
*/
OPERATOR "RENDERED_TO_RAW"
IF (RC ~= 0) THEN DO
ADPRO_TO_FRONT
OKAY1 "Converting rendered to raw failed."
ADPRO_TO_BACK
EXIT 10
END
END
/******************************************************************
The ripple operator.
******************************************************************/
XSIZE
CenterX = ADPRO_RESULT / 2
YSIZE
CenterY = ADPRO_RESULT / 2
OPERATOR "RIPPLE",
"CENTER" CenterX CenterY,
"PROPSPEED" 40,
"PERIOD" 40,
"AMPLITUDE" 50,
"PHASE" Phase,
"RAMP" 6,
"LEVELOFF" 1,
"WAVETYPE" "-1",
"FRAME" 10,
"NEWWAVE",
IF (RC ~= 0) THEN DO
Why = ADPRO_RESULT
ADPRO_TO_FRONT
OKAY1 "The operator RIPPLE" || NL ||,
"failed to execute." || NL ||,
Why
ADPRO_TO_BACK
EXIT 10
END
Phase = Phase + PhaseIncrement
IF Phase > 360 THEN Phase = Phase - 360
/*
** Update the clips.
*/
SETCLIP( "FREDPhase", Phase )
SETCLIP( "FREDOverrideLength", 1 )
EXIT 0